AddCSLuaFile( "cl_init.lua" ) 
AddCSLuaFile( "shared.lua" )

include('shared.lua') 

function ENT:Initialize() 

	Msg("npc_salesman spawned!!!")

	self:SetModel( self:GetNetworkedVar("npc_modelname" ,"models/Barney.mdl" )) 
	self:SetHullType( HULL_HUMAN ) 
	self:SetHullSizeNormal( )
	self:SetNPCState( NPC_STATE_SCRIPT )
	self:SetSolid( SOLID_BBOX ) 
	self:CapabilitiesAdd( CAP_ANIMATEDFACE | CAP_TURN_HEAD ) 
	self:SetUseType( SIMPLE_USE ) 
	self:DropToFloor()	
	self:SetMaxYawSpeed( 90 ) 

end

function ENT:OnTakeDamage()
	return false
end 

function ENT:AcceptInput( Name, Activator, Caller )	

	if (Name == "Use" and Caller:IsPlayer()) then
		
		umsg.Start(self:GetNetworkedVar("npc_umsg_message"), Caller)
			umsg.Float(self:GetNetworkedVar("npc_job_type", 0))
		umsg.End()
		
	end
	
end


